﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class GiaDichVuDAO
    {
        public bool m_Insert(GiaDichVuDTO _info)
        {

            int istop = 0;
            if (_info.Bstopsd == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMGiaDichVu_Insert '{0}',N'{1}',N'{2}',{3},{4},{5},{6},N'{7}',N'{8}','{9}'", _info.Smahieu, _info.Sdvt, _info.Stendvu, _info.Igiabieu, _info.Igiabhyt, istop, _info.IIDLoaiDichVuYTe, _info.STenGiaDVu, _info.SDonViTinh, _info.SMaBHYT);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        
        public bool m_Update(GiaDichVuDTO _info)
        {
            int istop = 0;
            if (_info.Bstopsd == true)
                istop = 1;
            string _sql = string.Format("usp_ThuNgan_DMGiaDichVu_Update {0},'{1}',N'{2}',N'{3}',{4},{5},{6},{7},N'{8}',N'{9}','{10}'", _info.Idvuid, _info.Smahieu, _info.Sdvt, _info.Stendvu, _info.Igiabieu, _info.Igiabhyt, istop, _info.IIDLoaiDichVuYTe, _info.STenGiaDVu, _info.SDonViTinh, _info.SMaBHYT);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);

        }

        public bool m_Delete(GiaDichVuDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMGiaDichVu_Delete {0}", _info.Idvuid);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllGiaDV()
        {
            string _sql = string.Format("usp_ThuNgan_DMGiaDichVu_SelectAll");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }
    }

}
